#include<iostream>
using namespace std;

const int kMaxN = (int)1e6 + 10;
const int kMod = (int)1e9 + 7;

int f[kMaxN][2] = {0};

void Mod(int &x){
    if(x < 0){
        x += kMod;
    }
    else if( x >= kMod){
        x -= kMod;
    }
}

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    
    int n, a, b;
    int sum_0, sum_1;
    int ans = 1;
    
    cin >> n >> a >> b;
    f[0][0] = f[0][1] = 1;
    sum_0 = f[0][0];
    sum_1 = f[0][1];
    for(int i = 1; i <= n; i++){
        ans <<= 1;
        Mod(ans);
        if(i >= a){
            sum_0 -= f[i - a][0];
            Mod(sum_0);
        }
        if(i >= b){
            sum_1 -= f[i - b][1];
            Mod(sum_1);
        }
        f[i][0] = sum_1;
        f[i][1] = sum_0;
        sum_0 += f[i][0];
        Mod(sum_0); 
        sum_1 += f[i][1];
        Mod(sum_1);
    }
    ans -= f[n][0];
    Mod(ans);
    ans -=f[n][1];
    Mod(ans);
    cout << ans << endl;
    return 0; 
}
